package cn.elwy.rcp.ui.table.model;

import java.io.Serializable;
import java.util.List;

public class TableConfig implements Serializable {

  private static final long serialVersionUID = 1L;

  private String id;
  private String name;
  // private int style;
  private String styleName;
  private String type;
  private boolean headerVisible;
  private boolean lineVisible;
  private int lineHeight;
  private boolean multipleSelection;
  private boolean isAutoRefresh;
  private int defaultRefreshInterval;

  private List<String> columnKeys;
  private List<ColumnInfo> columnInfoList;

  private boolean canCustomConfig;
  private boolean canSettingColumn;
  private boolean canEditor;
  private boolean canSave;
  private boolean canSort;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  // public int getStyle() {
  // return style;
  // }
  //
  // public void setStyle(int style) {
  // this.style = style;
  // }

  public String getStyleName() {
    return styleName;
  }

  public void setStyleName(String styleName) {
    if (styleName == null) {
      this.styleName = "";
    } else {
      this.styleName = styleName.toUpperCase();
    }
  }

  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }

  public boolean isHeaderVisible() {
    return headerVisible;
  }

  public void setHeaderVisible(boolean headerVisible) {
    this.headerVisible = headerVisible;
  }

  public boolean isLineVisible() {
    return lineVisible;
  }

  public void setLineVisible(boolean lineVisible) {
    this.lineVisible = lineVisible;
  }

  public int getLineHeight() {
    return lineHeight;
  }

  public void setLineHeight(int lineHeight) {
    this.lineHeight = lineHeight;
  }

  public boolean isMultipleSelection() {
    return multipleSelection;
  }

  public void setMultipleSelection(boolean multipleSelection) {
    this.multipleSelection = multipleSelection;
  }

  public boolean isAutoRefresh() {
    return isAutoRefresh;
  }

  public void setAutoRefresh(boolean isAutoRefresh) {
    this.isAutoRefresh = isAutoRefresh;
  }

  public int getDefaultRefreshInterval() {
    return defaultRefreshInterval;
  }

  public void setDefaultRefreshInterval(int defaultRefreshInterval) {
    this.defaultRefreshInterval = defaultRefreshInterval;
  }

  public List<String> getColumnKeys() {
    return columnKeys;
  }

  public void setColumnKeys(List<String> columnKeys) {
    this.columnKeys = columnKeys;
  }

  public List<ColumnInfo> getColumnInfoList() {
    return columnInfoList;
  }

  public void setColumnInfoList(List<ColumnInfo> columnInfoList) {
    this.columnInfoList = columnInfoList;
  }

  public boolean isCanCustomConfig() {
    return canCustomConfig;
  }

  public void setCanCustomConfig(boolean canCustomConfig) {
    this.canCustomConfig = canCustomConfig;
  }

  public boolean isCanSettingColumn() {
    return canSettingColumn;
  }

  public void setCanSettingColumn(boolean canSettingColumn) {
    this.canSettingColumn = canSettingColumn;
  }

  public boolean isCanEditor() {
    return canEditor;
  }

  public void setCanEditor(boolean canEditor) {
    this.canEditor = canEditor;
  }

  public boolean isCanSort() {
    return canSort;
  }

  public void setCanSort(boolean canSort) {
    this.canSort = canSort;
  }

  public boolean isCanSave() {
    return canSave;
  }

  public void setCanSave(boolean canSave) {
    this.canSave = canSave;
  }

  public ColumnInfo getColumnInfo(int columnIndex) {
    if (columnInfoList != null) {
      return columnInfoList.get(columnIndex);
    } else {
      return null;
    }
  }

}
